#!/usr/bin/env python
# -*- coding:UTF-8 -*-


"""
人民网测试爬虫
"""

import requests
from bs4 import BeautifulSoup
import json
import time


# 主页地址
main_url = "http://politics.people.com.cn/n1/2019/1017/c1024-31406102.html"

headers = {
    "User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/75.0.3770.100 Safari/537.36"
}

def main():
    """
    测试
    :return:
    """
    response = requests.get(main_url, headers=headers)

    soup = BeautifulSoup(response.content, "lxml")
    soups = soup.find_all("div", id='rwb_zw')
    for item in soups:
        print(item.text)


if __name__ == '__main__':
    main()